package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_镇街购买指标 实体类。
 *
 * @author 11987
 * @since 2025-07-01
 */
@Table(value = "LINDI_PURCHASE_TOWN_INDEX", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiPurchaseTownIndex extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 镇街购买指标ID
     */
    private Long purchaseTownIndexId;

    /**
     * 购买指标记录ID
     */
    private Long purchaseIndexRecordId;

    /**
     * 镇街名称
     */
    private String townName;

    /**
     * 购买亩数
     */
    private String townIndex;

    /**
     * 文件ID
     */
    private Long fileId;

    public LindiPurchaseTownIndex() {
    }

    public LindiPurchaseTownIndex(Long purchaseTownIndexId, Long purchaseIndexRecordId, String townName, String townIndex, Long fileId) {
        this.purchaseTownIndexId = purchaseTownIndexId;
        this.purchaseIndexRecordId = purchaseIndexRecordId;
        this.townName = townName;
        this.townIndex = townIndex;
        this.fileId = fileId;
    }

    public Long getPurchaseTownIndexId() {
        return purchaseTownIndexId;
    }

    public void setPurchaseTownIndexId(Long purchaseTownIndexId) {
        this.purchaseTownIndexId = purchaseTownIndexId;
    }

    public Long getPurchaseIndexRecordId() {
        return purchaseIndexRecordId;
    }

    public void setPurchaseIndexRecordId(Long purchaseIndexRecordId) {
        this.purchaseIndexRecordId = purchaseIndexRecordId;
    }

    public String getTownName() {
        return townName;
    }

    public void setTownName(String townName) {
        this.townName = townName;
    }

    public String getTownIndex() {
        return townIndex;
    }

    public void setTownIndex(String townIndex) {
        this.townIndex = townIndex;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiPurchaseTownIndex that = (LindiPurchaseTownIndex) o;
        return Objects.equals(purchaseTownIndexId, that.purchaseTownIndexId) &&
                Objects.equals(purchaseIndexRecordId, that.purchaseIndexRecordId) &&
                Objects.equals(townName, that.townName) &&
                Objects.equals(townIndex, that.townIndex) &&
                Objects.equals(fileId, that.fileId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), purchaseTownIndexId, purchaseIndexRecordId, townName, townIndex, fileId);
    }

    @Override
    public String toString() {
        return "LindiPurchaseTownIndex{" +
                "purchaseTownIndexId=" + purchaseTownIndexId +
                ", purchaseIndexRecordId=" + purchaseIndexRecordId +
                ", townName='" + townName + '\'' +
                ", townIndex='" + townIndex + '\'' +
                ", fileId=" + fileId +
                '}';
    }

    public static LindiPurchaseTownIndexBuilder builder() {
        return new LindiPurchaseTownIndexBuilder();
    }

    public static class LindiPurchaseTownIndexBuilder {
        private Long purchaseTownIndexId;
        private Long purchaseIndexRecordId;
        private String townName;
        private String townIndex;
        private Long fileId;

        LindiPurchaseTownIndexBuilder() {
        }

        public LindiPurchaseTownIndexBuilder purchaseTownIndexId(Long purchaseTownIndexId) {
            this.purchaseTownIndexId = purchaseTownIndexId;
            return this;
        }

        public LindiPurchaseTownIndexBuilder purchaseIndexRecordId(Long purchaseIndexRecordId) {
            this.purchaseIndexRecordId = purchaseIndexRecordId;
            return this;
        }

        public LindiPurchaseTownIndexBuilder townName(String townName) {
            this.townName = townName;
            return this;
        }

        public LindiPurchaseTownIndexBuilder townIndex(String townIndex) {
            this.townIndex = townIndex;
            return this;
        }

        public LindiPurchaseTownIndexBuilder fileId(Long fileId) {
            this.fileId = fileId;
            return this;
        }

        public LindiPurchaseTownIndex build() {
            return new LindiPurchaseTownIndex(purchaseTownIndexId, purchaseIndexRecordId, townName, townIndex, fileId);
        }

        @Override
        public String toString() {
            return "LindiPurchaseTownIndex.LindiPurchaseTownIndexBuilder(purchaseTownIndexId=" + this.purchaseTownIndexId + ", purchaseIndexRecordId=" + this.purchaseIndexRecordId + ", townName=" + this.townName + ", townIndex=" + this.townIndex + ", fileId=" + this.fileId + ")";
        }
    }
}
